<?php

namespace App\Models\Orders\Repositories\Interfaces;

use App\Models\Orders\Orders;
use App\Models\Plane\PlaneOrders\PlaneOrder;
use App\Models\Train\TrainOrders\TrainOrder;
use Illuminate\Support\Collection;

interface OrdersRepositoryInterface
{
    public function lists(array $param, int $page_size): Collection;

    public function createOrUpdateOrder(OrdersInterface $order, array $data): Orders;

    public function updateOrder(Orders $order, array $data): bool;

    public function getOrderInfo(string $order_sn): ?Orders;

    public function destroy(Orders $order): bool;

    /**
     * 列出同一行程的订单
     *
     * @param string $trip_id
     *
     * @return Collection
     */

    public function listByTripId(string $trip_id): Collection;

    public function listByTrainOrder(TrainOrder $order): Collection;

    public function findByTrainOrder(TrainOrder $order): Orders;

    public function findByPlaneOrder(PlaneOrder $order): Orders;

    public function findOneByTrainOrderTrip(TrainOrder $order): Orders;

    public function findOneByPlaneOrderTrip(PlaneOrder $order): Orders;

    public function getTransferInfo(Orders $order);

    public function lastOrder(string $user_id): ?Orders;
}